home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Online / SpeakFreely / src / vat.h < prev    next >
C/C++ Source or Header  |  2000-05-18  |  4KB  |  122 lines

  1. /*
  2.  * Copyright (c) 1991 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that the above copyright notice and this paragraph are
  7.  * duplicated in all such forms and that any documentation,
  8.  * advertising materials, and other materials related to such
  9.  * distribution and use acknowledge that the software was developed
  10.  * by the University of California, Lawrence Berkeley Laboratory,
  11.  * Berkeley, CA.  The name of the University may not be used to
  12.  * endorse or promote products derived from this software without
  13.  * specific prior written permission.
  14.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  15.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  16.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  17.  *
  18.  * @(#) $Header: /net/u4/hgs/multimedia/nevot/nevot/RCS/vat.h,v 1.1 1995/03/08 16:49:26 hgs Exp $ (LBL)
  19.  * modified for NEVOT by H. Schulzrinne
  20.  */
  21.  
  22. #ifndef vat_packet_h
  23. #define vat_packet_h
  24.  
  25. /*
  26.  * vat packet header (0 is MSB):
  27.  *
  28.  *  0                   1                   2                   3   
  29.  *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
  30.  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  31.  * | V |           |T|   |         |                               |
  32.  * | e |    NSID   |S| 0 |  Audio  |        Conference ID          |
  33.  * | r |           | |   | Format  |                               |
  34.  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  35.  * |                                                               |
  36.  * |                 Time Stamp (in audio samples)                 |
  37.  * |                                                               |
  38.  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  39.  *
  40.  *  protocol version (2 bits)
  41.  *  no. of speaker id's (6 bits) [= 0 if src address should be used as id]
  42.  *  flags (3 bits)
  43.  *  audio format (5 bits)
  44.  *  conference identifier (16 bits)
  45.  *  timestamp [in audio samples] (32 bits)
  46.  *  <0 to 63 4-byte speaker id's>
  47.  *  <audio data>
  48.  */
  49. typedef struct {
  50.     u_char nsid;
  51. #define        NSID_MASK    0x3f
  52.     u_char flags;
  53. #define        VATHF_NEWTS    0x80    /* set if start of new talkspurt */
  54. #define        VATHF_FMTMASK    0x1f    /* audio format bits */
  55.     u_short confid;
  56.     u_int ts;
  57. } vat_hdr_t;
  58.  
  59. /*
  60.  * Audio formats.
  61.  *   Numbers for 'standard' encodings are assigned 0 upwards.
  62.  *   Numbers for 'experimental' or non-standard encodings are
  63.  *   assigned from 30 downwards.  31 is reserved.  The intent
  64.  *   is that the lower numbers will be globally known and widely
  65.  *   implemented & others will be used only between mutually
  66.  *   consenting programs.
  67.  */
  68. typedef enum {
  69.   VAT_AUDF_MULAW8 =  0, /* 64 kb/s 8KHz mu-law encoded PCM */
  70.   VAT_AUDF_CELP   =  1, /* 4.8 kb/s FED-STD-1016 CELP */
  71.   VAT_AUDF_G721   =  2, /* 32 kb/s CCITT ADPCM */
  72.   VAT_AUDF_GSM    =  3, /* 13 kb/s GSM */
  73.   VAT_AUDF_G723   =  4, /* 24 kb/s CCITT ADPCM */
  74.   VAT_AUDF_L16_16 = 26, /* L16, 16000 samples/sec */
  75.   VAT_AUDF_L16_44 = 27, /* L16, 44100 samples/sec, 2 channels */
  76.   VAT_AUDF_LPC4   = 28, /* 4.8 kb/s LPC, 4 frames */
  77.   VAT_AUDF_LPC1   = 29, /* 4.8 kb/s LPC, 1 frame */
  78.   VAT_AUDF_IDVI   = 30, /* 32 kb/s Intel DVI ADPCM */
  79.   VAT_AUDF_UNDEF  = 31  /* undefined */
  80. } vat_audio_t;
  81.  
  82. /*
  83.  * Structure of a vat control message (sent to the 'session' port).
  84.  * All msgs have the same header:
  85.  *  protocol version (2 bits)
  86.  *  flags / misc (6 bits)
  87.  *  msg type (8 bits)
  88.  *  conference id
  89.  *
  90.  * An 'ID' message has a null-terminated ascii string giving the
  91.  * site id string immediately following the header.
  92.   *
  93.  * A 'DONE' message has no other information.
  94.  *
  95.  * The structure of an IDLIST is described below.
  96.  */
  97. struct CtrlMsgHdr {
  98.     u_char flags;
  99.     u_char type;
  100.     u_short confid;
  101. };
  102.  
  103. /*
  104.  * An IDLIST message contains:
  105.  *  control msg hdr
  106.  *  number of site id's in this msg (8 bits)
  107.  *  audio flags (3 bits)
  108.  *  audio format (5 bits)
  109.  *  audio block size (16 bits)
  110.  *  <site id entries>
  111.  * Each site id entry consists of a 4 byte site id followed by a
  112.  * null terminated ascii id string.  The string is padded with
  113.  * nulls to the next 4 byte boundary.
  114.  */
  115. struct IDMsgHdr {
  116.     struct CtrlMsgHdr h;
  117.     u_char nsids;
  118.     u_char ainfo;
  119.     u_short blksize;
  120. };
  121. #endif
  122.